<template>
	<view @click="goDetail()" class="card">
		<view class="title">
			<image v-if="props.order.order_service=='1'" src="../../../static/home/feed.png"></image>
			<image v-if="+props.order.order_service=='2'" src="../../../static/home/liu.png"></image>
			<image v-if="props.order.order_service=='3'" src="../../../static/home/jiyang.png"></image>
			<text v-if="props.order.order_service=='1'">上门喂宠</text>
			<text v-if="props.order.order_service=='2'">上门遛宠</text>
			<text v-if="props.order.order_service=='3'">寄养服务</text>
			<uni-icons type="right"></uni-icons>
		</view>
		<view class="detail">
			<view class="xinxi">
				<view class="time">
					<view>
						服务时间:{{props.order.start_time}}-{{props.order.end_time}}
					</view>
				</view>
				<view class="lianxi">
					<view>
						联系人:{{props.order.order_address.split(';')[1]+props.order.order_address.split(';')[2]}}
					</view>
				</view>
				<view class="location">
					<view>
						服务地址:{{props.order.order_address.split(';')[0]}}
					</view>
				</view>
			</view>
		</view>
		<slot name="bottom"></slot>
	</view>
</template>

<script lang="ts" setup>
	import {ref,reactive,defineProps,defineEmits} from "vue"
	interface Props {
	   order:Object
	}  
	const props=defineProps<Props>()
	const emits=defineEmits(['changefresh'])
	function goDetail(){
		emits('changefresh',1)
		uni.navigateTo({
			url:"/pages/order/detail?order="+JSON.stringify(props.order)
		})
	}
	function gopingjia(){
		uni.navigateTo({
			url:"/pages/order/pingjia?service_id="+props.order.order_service+"&people_id="+props.order.order_people.people_id+"&order_id="+props.order.order_id
		})
	}
</script>

<style lang="scss">
	.card{
		width: 100%;
		background-color: #fff;
		box-sizing: border-box;
		padding: 20rpx;
		border-radius: 20rpx;
		margin-bottom: 10rpx;
		
		.title{
			width: 100%;
			display: flex;
			align-items: center;
			margin-bottom: 20rpx;
			font-size: 30rpx;
			
			image{
				width: 40rpx;
				height: 40rpx;
				margin-right: 5rpx;
			}
		}
		
		.detail{
			display: flex;
			width: 100%;
			box-sizing: border-box;
			padding: 0 10rpx;	
			
			.xinxi{
				width: 100%;
				
				.time,.lianxi,.location{
					width: 100%;
					display: flex;
				}
			}
		}
	}
	.button{
		display: flex;
		width: 100%;
		box-sizing: border-box;
		justify-content: flex-end;
		margin-bottom: 40rpx;
		padding: 0 20rpx;
		
		&-item{
			background-color: #f3f6f7;
			border-radius: 20rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 150rpx;
			height: 60rpx;
			margin-left: 20rpx;
		}
	}
</style>
